﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>会员列表-微街秀管理后台</title>
    <link href="../css/css.css" rel="stylesheet" type="text/css" />
<style>
table{border-collapse: collapse;border: none;width: 980px; text-align:center;}
td{border: solid #ccc 1px;color:Black; height:26px; font-size:14px;}
td a{ text-decoration:none; color:#000;}
.td1,.td2,.td3,.td6{width:100px; font-weight:bold; text-align:center;}
.td4,.td5{width:250px; font-weight:bold; text-align:center;}
</style>
    <script src="../js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="../js/base.js" type="text/javascript"></script>
    <script src="../js/ajax-data.js" type="text/javascript"></script>
    <script src="../js/Pager.js" type="text/javascript"></script>
    <script src="../js/dialog.js" type="text/javascript"></script>
</head>
<body>
<div style="width:980px; margin-left:auto; margin-right:auto;">

<div style="font-size:14px; height:30px;">
    会员编号:<input type="text" id="userid" name="userid" style="width:80px;" />
    代理商ID:<input type="text" id="agentid" name="agentid" style="width:80px;" />
    手机号：<input type="" id="phone" name="phone" style="width:90px;" />
    用户名:<input type="text" id="name" name="name" style="width:90px;"/>
    昵称:<input type="text" id="nick_name" name="nick_name" style="width:90px;"/>
    <input type="button" id="btn" value="搜 索" onclick="submits()" /></div>
  <table id="list">
    </table>
 <div class="pager_style">
    <ul class="page_num"></ul>
    <ul class="page_info">
        <li>总数:<span id="count">0</span></li>
        <li>每页:<span id="pageSize">0</span></li>
        <li>页数:<span id="pageToal">0</span></li>
    </ul>
</div>
<input type="hidden" id="pagecount" value="0" />
</div>

 <script>
     var pager = new Pager();
     $(function () {
         islogin();
         GetList(1);
     })

     function GetList(page) {       
         var param = GetParam(page);
         $("#list").html("");
         var html = "<tr><td class='td1'>ID</td><td class='td2'>用户名</td><td class='td5'>昵称</td><td class='td3'>代理商</td><td class='td3'>手机号</td><td class='td3'>QQ</td><td class='td4'>注册日期</td><td class='td3'>状态</td><td class='td3'>套餐</td><td class='td6'>操作</td></tr>";

         AjaxStart("../ajax/user.ashx?getlist", param, function (data) {
             if (data.code != 0) {
                 $("#list").html(html + "<tr><td colspan='9'>" + data.msg + "</td></tr>");
             }
             else {
                 $("#list").html("");
                 var list = data.item.table;
                 for (var i = 0; i < list.length; i++) {
                     var state = "正常";
                     if (list[i].state == 0)
                         state = "<span color='red'>禁用</span>";
                     html += "<tr>";
                     html += "<td>" + list[i].id + "</td>";
                     html += "<td><a href='edit.aspx?id=" + list[i].id + "&name=" + list[i].name + "'>" + list[i].name + "</a></td>";
                     html += "<td><a href='edit.aspx?id=" + list[i].id + "&name=" + list[i].name + "' title='点击查看详情'>" + list[i].nick_name + "</a></td>";
                     html += "<td><a href='edit.aspx?id=" + list[i].agentid + "&name=" + list[i].name + "'  title='点击查看代理商资料'>" + (list[i].agentid > 0 ? list[i].agentid : "") + "</a></td>";
                     html += "<td>" + (list[i].phone == null ? "" : list[i].phone) + "</td>";
                     html += "<td>" + (list[i].qq == null ? "" : list[i].qq) + "</td>";
                     html += "<td>" + list[i].date + "</td>";
                     html += "<td>" + state + "</td>";
                     html += "<td><a href='palist.html?id=" + list[i].id + "&name=" + list[i].nick_name + "'>" + (list[i].number > 0 ? "正式版" : "试用版") + "</a></td>";
                     html += "<td><a href='edit_pass.html?id=" + list[i].id + "'>修改密码</a></td>";
                     html += "</tr>";
                 }
                 $("#list").html(html);
             }
             pager.initPage(page, data.item.itemCount, 20, 5, GetList);
         });
     }

     function GetParam(page) {
         var userid = $("#userid").val();
         var agentid = $("#agentid").val();
         var phone = $("#phone").val();
         var name = $("#name").val();
         var nick_name = $("#nick_name").val();
         var param = "page_index=" + page;
         if (userid != "")
             param += "&userid=" + userid;
         if (agentid != "")
             param += "&agentid=" + agentid;
         if (phone != "")
             param += "&phone=" + phone;
         if (name != "")
             param += "&name=" + name;
         if (nick_name != "")
             param += "&nick_name=" + nick_name;
         return param;
     }

//     function search() {
//         var param = "";
//         document.location.href = 'list.html?' + param;
//     }

     function submits() {
         islogin();
         GetList(1);
     }
 </script>
</body>
</html>
